﻿@model HomeViewModel
@{
    Page.Title = Model.SiteConfig.SiteName;
    #region 公共数据
    ViewBag.SiteConfig = Model.SiteConfig;
    ViewBag.HeaderViewModel = Model.HeaderViewModel;
    ViewBag.FooterViewModel = Model.FooterViewModel; 
    #endregion
    Layout = "~/Areas/WebAdmin/Views/Template/_Layout.cshtml";
}

@if (Model.Banner.Count() > 0)
{
    <div id="sliderBox" class="bc sliderBox">
        <div class="bd">
            <ul>
                @foreach (var item in Model.Banner)
                {
                    string url = item.LinksUrl;
                    if (string.IsNullOrEmpty(item.LinksUrl)|| item.LinksUrl=="")
                    {
                        url = "javascript:;";
                    }

                <li>
                    <a href="@url" target="@item.LinksTarget">
                        <img src="@item.ImgLG" />
                        <div class="textBg">
                            <p class="baseWidth bc ellipsis">@item.Title</p>
                        </div>
                    </a>
                </li>
                }
            </ul>
        </div>
        <div class="icon">
            <div class="hd">
                <ul></ul>
            </div>
        </div>
    </div>
    <!--图片轮播 end-->
}

    <div class="baseWidth bc clearfix">
        @if (Model.Noitce.Count() > 0)
        {
        <dl class="homeNews">
            <dt>
                <h2>@Model.NoitceNav.NavName</h2>
                <a href="@Model.NoitceNav.NavUrl" class="more">更多...</a>
            </dt>
            <dd>
                <ul class="list">
                    @foreach (var item in Model.Noitce)
                    {
                        string cont = item.Cont;
                        if (!string.IsNullOrEmpty(cont))
                        {
                            cont = CommonHelper.FormatStr(CommonHelper.NoHTML(cont), 115);
                        }
                    <li class="clearfix">
                        <a href="@item.LinksUrl">
                            <div class="img">
                                <img src="@item.ImgLG" class="img-responsive">
                            </div>
                            <div class="cont">
                                <h3 class="title ellipsis">@item.Title</h3>
                                <div class="info">@Html.Raw(cont)</div>
                                <div class="date">@item.SubmitDate.ToString("yyyy-MM-dd")</div>
                            </div>
                        </a>
                    </li>
                    }
                </ul>
            </dd>
        </dl>
        <!--最新通知-->
        }

        @if (Model.News.Count() > 0)
        {
        <dl class="homeNews">
            <dt>
                <h2>@Model.NewsNav.NavName</h2>
                <a href="@Model.NewsNav.NavUrl" class="more">更多...</a>
            </dt>
            <dd>
                <ul class="list">
                @foreach (var item in Model.News)
                {
                    string cont = item.Cont;
                    if (!string.IsNullOrEmpty(cont))
                    {
                        cont = CommonHelper.FormatStr(CommonHelper.NoHTML(cont), 115);
                    }
                    <li class="clearfix">
                        <a href="@item.LinksUrl">
                            <div class="img">
                                <img src="@item.ImgLG" class="img-responsive">
                            </div>
                            <div class="cont">
                                <h3 class="title ellipsis">@item.Title</h3>
                                <div class="info">@Html.Raw(cont)</div>
                                <div class="date">@item.SubmitDate.ToString("yyyy-MM-dd")</div>
                            </div>
                        </a>
                    </li>
                }
                </ul>
            </dd>
        </dl>
        <!--书院要闻-->
        }
    </div>
    <!-- 最新通知 书院要闻 end -->
    
    @if (Model.About != null)
    {
    <div class="homeAboutUs">
        <div class="baseWidth bc">
            @Html.Raw(Model.About.Cont)
        </div>
    </div>
    <!--书院简介 end-->
    }

    @if (Model.Study.Count() > 0)
    {
    <dl class="baseWidth bc homeStudy">
        <dt>@Model.StudyNav.NavName</dt>
        <dd>
            <ul class="list clearfix">
            @foreach (var item in Model.Study)
            {
                <li>
                    <a href="@item.LinksUrl">
                        <img src="@item.ImgLG" class="img-responsive">
                        @*<p class="title ellipsis">@item.Title</p>*@
                    </a>
                </li>
            }
            </ul>
        </dd>
    </dl>
    <!--学在明德 end -->
    }

@section FooterScript
{
    <!-- 图片轮播 begin -->
    <script src="/Scripts/jquery.SuperSlide.2.1.2.js"></script>
    <script type="text/javascript">
        $(function () {
            jQuery(".sliderBox").slide({ titCell: ".hd ul", mainCell: ".bd ul", effect: "leftLoop", vis: "auto", autoPlay: true, autoPage: true, trigger: "click" });
        });
    </script>
    <!-- 图片轮播 end -->
}